package stuServlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import dao.StudentDAO;

@SuppressWarnings("serial")
public class doDeleteServlet extends HttpServlet {

	public doDeleteServlet() {
		super();
	}

	public void destroy() {
		super.destroy(); // Just puts "destroy" string in log
		// Put your code here
	}

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		this.process(request, response);

	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		this.process(request, response);

	}
	public void process(HttpServletRequest request, HttpServletResponse response)
	throws ServletException, IOException {
		String []ids=request.getParameterValues("one");
		StudentDAO sdao=new StudentDAO();
		sdao.delete(ids);
		request.getRequestDispatcher("doShowList").forward(request, response);
		
	}

	public void init() throws ServletException {
		// Put your code here
	}

}
